package com.kaishengit.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.kaishengit.dao.InfoDao;
import com.kaishengit.dao.core.DateUtil;
import com.kaishengit.pojo.Info;

@Transactional
public class InfoService {
	private InfoDao infoDao;
	public void save(Info info) {
		info.setCreatetime(DateUtil.getNow());
		
		infoDao.save(info);
	}
	public void setInfoDao(InfoDao infoDao) {
		this.infoDao = infoDao;
	}
	public List<Info> findAll() {
		String hql="from Info order by createtime desc ";
		return infoDao.find(hql);
	}
	
	public void del(Info info) {
		infoDao.del(info);
	}
	public Info findById(String infoid) {
		return infoDao.findByUnique("id", infoid);
	}
	
	

}
